import http from "@/http"
import { ListParam, LoginParm, UpdateParm, User } from "./UserModel"


export const addAdminUserApi = (param: User) => {
    return http.post('/api/sysUser', param)
}

// 查询管理员
export const getListApi = (param: ListParam) =>{
    return http.get('/api/sysUser/getList', param)
}

// 修改管理员
export const editAdminApi = (param: User) =>{
    return http.put('/api/sysUser', param)
}

// 删除管理员
export const deleteAdminApi = (id: string) =>{
    return http.delete('/api/sysUser/' + id)
}

//生成验证码
export const imageApi = ()=>{
    return http.get("/api/sysUser/image")
} 
//后台登录
export const lgoinApi = (parm:LoginParm)=>{
    return http.post("/api/sysUser/login",parm)
} 

//修改密码
export const updatePasswordApi = (parm:UpdateParm)=>{
    return http.put("/api/sysUser/updatePassword",parm)
} 